package com.econ.powercloud.ems.common.enums;

/**
 * @ Description:
 * @ Author：hgp
 * @ Create:2022-05-09-16:13
 */
public enum EventDealStatusType implements EnumMethod{
    UN_DEAL(0,"未处理"),
    DEAL(1,"已处理");
    private Integer code;

    private String desc;
    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }
    EventDealStatusType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }
    public static EventDealStatusType fromCode(int code){
        for(EventDealStatusType type: EventDealStatusType.values()){
            if(type.getCode() == code){
                return type;
            }
        }
        return null;
    }

    public static String getDescFromCode(int code){
        for(EventDealStatusType type: EventDealStatusType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
